﻿@model IList<FB.Providers.EmployeeInfo.Company>
@helper NodeHelper(FB.Providers.EmployeeInfo.Company post, IList<FB.Providers.EmployeeInfo.Company> postList, string seedpading)
{ 
    IList<FB.Providers.EmployeeInfo.Company> list = postList.Where(t => t.ParentCOMCode == post.COMCode).ToList();
   
    if (list.Count != 0)
    {
        
        foreach (FB.Providers.EmployeeInfo.Company postItem in list)
       {
           <option  value="@postItem.COMCode"  CompanyName="@postItem.Name">@(seedpading+postItem.Name)</option>  
            @NodeHelper(postItem, Model,seedpading+"--")   
       } 
    } 
}
<select id="CompanyList" style="width:120px; margin-left: 5px;" name="COMCode"  class="CompanyList">  
@{
    IList<FB.Providers.EmployeeInfo.Company> rootNodeList = Model.Where(t => t.ParentCOMCode == null|| t.ParentCOMCode == "").ToList();
    if (rootNodeList != null && rootNodeList.Count>0)
    {
        foreach (var item in rootNodeList)
        {
           
            <option value="@item.COMCode"   CompanyName="@item.Name">@item.Name</option>
            @NodeHelper(item, Model,"--")   
        }
    } 
}
</select>